#include <iostream>
#include <map>
#include <string>
using namespace std;

int main()
{
  map <string, size_t> m;
  string s;

  while(cin >> s)
  {
    int ch1 = s[0];

    if ((ch1>64)&&(ch1<91)) s[0]=ch1+32;
 
    if ((s[s.length()-1]>32)&&(s[s.length()-1]<48)||
        (s[s.length()-1]>57)&&(s[s.length()-1]<65)||
        (s[s.length()-1]>90)&&(s[s.length()-1]<97)||
        (s[s.length()-1]>122)&&(s[s.length()-1]<127))
    {
      s.erase(s.length()-1,1);
    }

    if ((s[0]>32)&&(s[0]<48)||
        (s[0]>57)&&(s[0]<65)||
        (s[0]>90)&&(s[0]<97)||
        (s[0]>122)&&(s[0]<127))
    {
      for (int j=1; j<s.length()+1; j++ )
      {
        s[j-1]=s[j];
      }
      s.erase(s.length()-1,2);
    }
   
    m[s]++;
  }

  map <string,size_t>::const_iterator i = m.begin();

  while(i!=m.end())
  {
    cout << i->first << " - " << i->second << endl;
    i++;
  }

return 0;
}
